From 1c89143b630a5b3913fa19fe208ecc9874e24774 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Sun, 1 Mar 2009 14:30:35 +0000 Subject: [PATCH] x86, time: fix S3 suspend error platform_time_calibration() is invoked in S3 when irq is disabled, which causes ASSERT() error in spin_lock_irq(). spin_lock_irqsave() saves us. Signed-off-by: Guanqun Lu --- xen/arch/x86/time.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 6030915a83..97ec6f96ee 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -607,13 +607,14 @@ static void platform_time_calibration(void) { u64 count; s_time_t stamp; + unsigned long flags; - spin_lock_irq(&platform_timer_lock); + spin_lock_irqsave(&platform_timer_lock, flags); count = plt_stamp64 + ((plt_src.read_counter() - plt_stamp) & plt_mask); stamp = __read_platform_stime(count); stime_platform_stamp = stamp; platform_timer_stamp = count; - spin_unlock_irq(&platform_timer_lock); + spin_unlock_irqrestore(&platform_timer_lock, flags); } static void resume_platform_timer(void) -- 2.30.2